package FileDemo;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class FileDemo {
	
	public static void main(String[] args) {
		
		File file = new File("a.txt");
		try {
			file.createNewFile();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		String name = file.getName();
		System.out.println(name);
		
		long length = file.length();
		System.out.println(length);
		
		long time = file.lastModified();
		Date date = new Date(time);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String timeStr = sdf.format(date);
		System.out.println(timeStr);
		
	}

}
